package com.syni.mdd.yhd.common.all.dao.jpa.user;

import com.syni.mdd.yhd.common.all.dao.BaseJPADao;
import com.syni.mdd.yhd.common.all.entity.user.BmsUser;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Set;

public interface BmsUserDao extends BaseJPADao<BmsUser,Integer> {
    BmsUser findByOpenid(String openId);

    @Query(value="select t.dxshh from bms_user t where t.dxshh LIKE 'X_____1%' and t.dxshh not like 'X00%' order by t.id desc limit 1",nativeQuery=true)
    String findByDxshh();

    BmsUser findByPhone(String phone);

    BmsUser findByUnionid(String unionId);

    BmsUser findByAliUserId(String unionId);

    List<BmsUser> findByDxshhLike(String dxshNum, Pageable pageable);

    List<BmsUser> findByDxshhLikeAndLoginNameIsNull(String dxshNum, Pageable pageable);

    List<BmsUser> findByIdIn(Set<Integer> userIds);

    BmsUser findByAccountId(String accountId);

    BmsUser findByIosUserId(String iosUserId);
}
